package com.nyl.learn.hr.ws;

/**
 * Created by nyl
 * 2017/4/11
 */

import com.nyl.learn.hr.model.HolidayRequest;
import com.nyl.learn.hr.model.HolidayResponse;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;

@Endpoint
public class HolidayEndpoint {
    private static final String NAMESPACE_URI = "http://mycompany.com/hr/webservice";
   
    
    @PayloadRoot(namespace = NAMESPACE_URI, localPart = "holidayRequest")
    @ResponsePayload
    public HolidayResponse handleHolidayRequest(@RequestPayload HolidayRequest holidayRequest) throws
            Exception {
    
        System.out.println("请求进来了");
    
    
        HolidayResponse holidayResponse = new HolidayResponse();
        holidayResponse.setName("中华田园犬");
        holidayResponse.setAge(5);
        
        return holidayResponse;
    }
    
    
    
}
